import React from 'react';
import { Switch, Route } from 'react-router';

import { Home } from './views/Home';
import { Detail } from './views/Detail';
import { Cart } from './views/Cart';

function App() {
  return (
    <div className="App">
      <Switch>
        <Route path="/" exact component={Home}></Route>
        {/* 记录消费者选择的产品id颜色版本和数量以便于购物车拿到用户数据 */}
        <Route path="/detail/:id/:cid/:vid/:count" component={Detail}></Route>
        <Route path="/cart" component={Cart}></Route>
      </Switch>
    </div>
  );
}

export default App;
